<template>
	<view class="body">
		<view> 
		<rookie-list  v-for="(item,index) in list" :key="index" :src="item.image" :title="item.name"
				:status="item.status" @click="info(item)" :people="item.liked" :price="item.bids" :num="item.count"></rookie-list>
		<view class="none" v-if="list.length<=0">
			数据为空
		</view>
		</view>
	</view>
</template>

<script>
	import global from '../../config/global';
	import apis from '@/api/index.js'
	import {
		requestApi,uphttp
	} from '@/utils/request.js'
	// 导入公共组件方法
	import common from '@/common/js/common.js';
	export default {
		data() {
			return {
				searchValue:{
					status:1,
					sellType: "0"
				},
				list: []
			}
		},
		onLoad(e) {
			if(e.type!=null){
				this.searchValue.typeId = e.type;
			}
			this.getList();
		},
		methods: {
			getList() {
				requestApi(apis.products.list,this.searchValue,'get').then(res=>{
					res.data.forEach(item=>{
						item.image = global.REQUEST_URL+item.image
						if(item.status == 0){
							item.status = "在拍卖"
						}else{
							item.status = "已结拍"
						}
					})
					this.list = res.data;
				})
			},
			info(item){
				uni.navigateTo({
					url:"/pages/goods-detail/goods-detail?id="+item.productId
				})
			}
		}
	}
</script>

<style>
	.body{
		padding: 15px 32rpx 0;
		min-height: 100vh;
		background-image: url('../../static/bgc.png');
		background-size: 100% 100%;
		background-repeat: no-repeat;
		
	}
	.add {
		position: fixed;
		z-index: 10;
		width: 120rpx;
		height: 120rpx;
		right: 20rpx;
		bottom: 100rpx;
	}
	.none{
		width: 100%;
		height: 100vh;
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translateX(-8%);
	}
</style>